<?php
/* @var $this SiteController */

$this->pageTitle = ' ';
$baseUrl = Yii::app()->request->baseUrl;
Yii::app()->clientScript->registerCssFile($baseUrl . '/css/slide.css');
?>
<div class="row">
    <div id="banner">
        <img src="images/image_960x340_01.jpg" />
    </div>
    <div id="wowslider-container1">
        <?php
        $slides = Slide::model()->findAll('1 ORDER BY position ASC');
        ?>
        <div class="ws_images">
            <ul>
                <?php
                foreach ($slides as $val)
                    if ($val->image != "") {
                        $link = $val->link;
                        if($link=="")
                            $link="#";
                            elseif ($link!="#" && substr_compare($link,'http',0)<0)
                                $link=$baseUrl.'/'.$link ; 
                        
                        echo '<li>';
                        echo CHtml::link(CHtml::image($baseUrl . '/protected/uploads/images/slides/' . $val->image, $val->image, array('title' => $val->title)),$link);
                        echo $val->description . '</li>';
                    }
                ?>
            </ul>
        </div>
        <div class="ws_bullets">
            <div>
                <?php
                $count =0;
                foreach ($slides as $val)
                    if ($val->image != "") {
                        echo CHtml::link(CHtml::image($baseUrl . '/protected/uploads/images/slides/' . $val->image_thumb, $val->image_thumb).$count++);
                        
                    }
                ?>
               
            </div>
        </div>
        <div class="ws_shadow">
        </div>
        <script type="text/javascript" src="<? echo $baseUrl?>/scripts/wowslider.js"></script>
        <script type="text/javascript" src="<? echo $baseUrl?>/scripts/script.js"></script>
    </div>
    <!-- Slideshow  -->
</div>
<!-- End ROW -->
<div class="row light-gray">

</div>
<div class="row light-gray">
    <section>
        <div class="row-content simpleBox">
            <div id="chooseGroup">
                <article>
                    <?php $content =  HomepageContent::model()->findByPk(1);
                    $link = new Link($content->link);
                    echo CHtml::link(CHtml::image($baseUrl . '/protected/uploads/images/' . $content->image, $content->image, array('title' => $content->title)),$link->getLink());
                    ?>
                    <h2>
                        <?php echo CHtml::encode($content->title); ?>
                    </h2>
                    <p>
                        <?php echo $content->content ;?>
                    </p>
                </article>
            </div>
            <div class="center-box">
                <article>
                    <?php $content =  HomepageContent::model()->findByPk(2);
                    $link = new Link($content->link);
                    echo CHtml::link(CHtml::image($baseUrl . '/protected/uploads/images/' . $content->image, $content->image, array('title' => $content->title)),$link->getLink());
                    ?>
                    <h2>
                        <?php echo CHtml::encode($content->title); ?>
                    </h2>
                    <p>
                        <?php echo $content->content ;?>
                    </p>
                </article>
            </div>
            <div class="dx last">
                <article>
                    <?php $content =  HomepageContent::model()->findByPk(3);
                    $link = new Link($content->link);
                    echo CHtml::link(CHtml::image($baseUrl . '/protected/uploads/images/' . $content->image, $content->image, array('title' => $content->title)),$link->getLink());
                    ?>
                    <h2>
                        <?php echo CHtml::encode($content->title); ?>
                    </h2>
                    <p>
                        <?php echo $content->content ;?>
                    </p>
                </article>
            </div>
        </div>
    </section>
</div>